# pymysql入门案例
import pymysql

if __name__ == '__main__':
    # 获取连接对象
    conn = pymysql.connections.Connection(host="127.0.0.1",user="root",passwd="root",db="test",port=3306,charset="utf8")
    # 通过连接对象 获取游标对象
    cursor = conn.cursor()
    #　定义sql语句
    sql = "insert into author values(5,'坤坤',30)"
    # 执行sql
    cursor.execute(sql)
    # 提交事务
    conn.commit()
    # 关闭 释放资源
    cursor.close()
    conn.close()
	# laozhang修改一下子